Conversation
📝 WalkthroughWalkthroughThis PR adds documentation and example code for the 261st RSCG: Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
v2/rscg_examples_site/src/components/HomepageFeatures/index.js (1)
7-7: Avoid hard-coded example totals in homepage copy.Line 7 is correct for this PR, but this string will drift again on the next addition. Consider binding it to a generated source (same source used by lists/exports) so the count updates automatically.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/rscg_examples_site/src/components/HomepageFeatures/index.js` at line 7, The title string in the HomepageFeatures component is hard-coded; instead compute it from the canonical examples data source used elsewhere (the same exported array/list used by lists/exports) and build the title dynamically (e.g., use examples.length for total and a filtered count for MSFT entries) so the title updates automatically; locate the title assignment in HomepageFeatures (the "title" variable/string) and replace the literal with a template built from the derived counts.v2/rscg_examples/NLog.Extensions.ThisClass/description.json (1)
15-16: Use empty arrays instead of[""]for optional list fields.Using empty-string elements can cause ambiguous path handling downstream. Prefer true empty arrays when there are no values.
♻️ Proposed fix
- "excludeDirectoryGenerated":[""], - "includeAdditionalFiles":[""] + "excludeDirectoryGenerated":[], + "includeAdditionalFiles":[]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/rscg_examples/NLog.Extensions.ThisClass/description.json` around lines 15 - 16, The JSON description uses [""] for optional list fields which inserts an empty-string element; update the fields excludeDirectoryGenerated and includeAdditionalFiles to be empty arrays ([]) instead of [""] so they represent no entries and avoid ambiguous path handling downstream; ensure the JSON remains valid after replacing the values.v2/rscg_examples_site/docs/RSCG-Examples/NLog.Extensions.ThisClass.md (1)
55-55: Consider adjusting heading level for consistency.Line 55 uses
######(h6) for the "ThisClass" subsection, which skips heading levels (h4 and h5 are missing). While this may be intentional for visual styling, it violates the semantic heading hierarchy convention. Consider using####(h4) instead for better accessibility and document structure.♻️ Optional fix for heading hierarchy
-###### ThisClass +#### ThisClass Add the `ThisClassAttribute` to generate type information for a class.And similarly for line 69:
-###### NLog.Extensions.ThisClass +#### NLog.Extensions.ThisClass Create class loggers without using reflection.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/rscg_examples_site/docs/RSCG-Examples/NLog.Extensions.ThisClass.md` at line 55, The "###### ThisClass" heading uses an h6 level which skips intermediate heading levels; update the heading text "###### ThisClass" to "#### ThisClass" to restore proper semantic hierarchy and accessibility, and apply the same adjustment to the other occurrence referenced (the similar heading at the later occurrence around line 69) so both use "####" instead of "######".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@v2/book/examples/NLog.Extensions.ThisClass.html`:
- Line 2: The HTML file is missing a doctype declaration which can trigger
standards-mode inconsistencies; add the HTML5 doctype declaration (<!DOCTYPE
html>) as the very first line of v2/book/examples/NLog.Extensions.ThisClass.html
so it appears before the existing <h1> element and any other content, ensuring
the document renders in standards mode.
In `@v2/book/list.html`:
- Line 20: The raw '>' character in the text "This is the list of 261 RSCG with
examples =>" is triggering HTML linting (spec-char-escape); update the text in
v2/book/list.html (the string containing "This is the list of 261 RSCG with
examples =>") to escape the greater-than sign (e.g., replace '>' with '>') so
the content is valid HTML and passes HTMLHint.
In `@v2/rscg_examples_site/docs/Categories/EnhancementClass.md`:
- Line 57: The badge URL string
"https://img.shields.io/www.nuget.org/stars/packages/System.Runtime.InteropServices?style=social"
in EnhancementClass.md is malformed; replace or remove that badge. Locate the
badge next to the existing NuGet download badge (the string containing
System.Runtime.InteropServices) and either remove the invalid
"www.nuget.org/stars" badge or swap it for a valid Shields endpoint such as a
NuGet version/download badge (for example use
"https://img.shields.io/nuget/v/System.Runtime.InteropServices?label=nuget" or
"https://img.shields.io/nuget/dt/System.Runtime.InteropServices?label=System.Runtime.InteropServices")
or, if you intended to show repo stars, replace with a GitHub stars badge using
the correct repo owner/name via
"https://img.shields.io/github/stars/{owner}/{repo}?style=social".
In `@v2/rscg_examples/NLog.Extensions.ThisClass/video.json`:
- Line 36: Fix the malformed JSON around the SpeakTest token: either add
SpeakTest as a quoted property on the preceding step object (e.g., add
"SpeakTest": "..." inside that object) or, more likely, make SpeakTest a
separate array element by replacing the invalid unquoted `SpeakTest=" "` with a
proper JSON object like {"SpeakTest": " "} as its own array entry; also remove
the trailing comma after the final array element on line 38 so the array ends
with a valid element instead of a dangling comma.
---
Nitpick comments:
In `@v2/rscg_examples_site/docs/RSCG-Examples/NLog.Extensions.ThisClass.md`:
- Line 55: The "###### ThisClass" heading uses an h6 level which skips
intermediate heading levels; update the heading text "###### ThisClass" to "####
ThisClass" to restore proper semantic hierarchy and accessibility, and apply the
same adjustment to the other occurrence referenced (the similar heading at the
later occurrence around line 69) so both use "####" instead of "######".
In `@v2/rscg_examples_site/src/components/HomepageFeatures/index.js`:
- Line 7: The title string in the HomepageFeatures component is hard-coded;
instead compute it from the canonical examples data source used elsewhere (the
same exported array/list used by lists/exports) and build the title dynamically
(e.g., use examples.length for total and a filtered count for MSFT entries) so
the title updates automatically; locate the title assignment in HomepageFeatures
(the "title" variable/string) and replace the literal with a template built from
the derived counts.
In `@v2/rscg_examples/NLog.Extensions.ThisClass/description.json`:
- Around line 15-16: The JSON description uses [""] for optional list fields
which inserts an empty-string element; update the fields
excludeDirectoryGenerated and includeAdditionalFiles to be empty arrays ([])
instead of [""] so they represent no entries and avoid ambiguous path handling
downstream; ensure the JSON remains valid after replacing the values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 08a725ec-1b52-4c9e-9195-9b782b4909c6
⛔ Files ignored due to path filters (3)
v2/Generator/all.csvis excluded by!**/*.csvv2/rscg_examples_site/static/exports/RSCG.xlsxis excluded by!**/*.xlsxv2/rscg_examples_site/static/sources/NLog.Extensions.ThisClass.zipis excluded by!**/*.zip
📒 Files selected for processing (25)
README.mdlater.mdv2/.tours/NLog.Extensions.ThisClass.tourv2/RSCGExamplesData/GeneratorDataRec.jsonv2/book/examples/NLog.Extensions.ThisClass.htmlv2/book/list.htmlv2/book/pandocHTML.yamlv2/rscg_examples/NLog.Extensions.ThisClass/description.jsonv2/rscg_examples/NLog.Extensions.ThisClass/nuget.txtv2/rscg_examples/NLog.Extensions.ThisClass/readme.txtv2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo.slnxv2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/LogDemo.csprojv2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/NLog.configv2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/Person.csv2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/Program.csv2/rscg_examples/NLog.Extensions.ThisClass/video.jsonv2/rscg_examples_site/docs/Authors/Trym_Pet.mdv2/rscg_examples_site/docs/Categories/EnhancementClass.mdv2/rscg_examples_site/docs/Categories/_PrimitiveEnhancementClass.mdxv2/rscg_examples_site/docs/RSCG-Examples/NLog.Extensions.ThisClass.mdv2/rscg_examples_site/docs/RSCG-Examples/index.mdv2/rscg_examples_site/docs/about.mdv2/rscg_examples_site/docs/indexRSCG.mdv2/rscg_examples_site/src/components/HomepageFeatures/index.jsv2/rscg_examples_site/static/exports/RSCG.json
| @@ -0,0 +1,69 @@ | |||
|
|
|||
| <h1>RSCG nr 261 : NLog.Extensions.ThisClass</h1> | |||
There was a problem hiding this comment.
Add an HTML doctype declaration at the top.
The document starts with content but no doctype, which matches the static-analysis error and can cause standards-mode inconsistencies.
🛠️ Proposed fix
+<!doctype html>
<h1>RSCG nr 261 : NLog.Extensions.ThisClass</h1>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <h1>RSCG nr 261 : NLog.Extensions.ThisClass</h1> | |
| <!doctype html> | |
| <h1>RSCG nr 261 : NLog.Extensions.ThisClass</h1> |
🧰 Tools
🪛 HTMLHint (1.9.2)
[error] 2-2: Doctype must be declared before any non-comment content.
(doctype-first)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/book/examples/NLog.Extensions.ThisClass.html` at line 2, The HTML file is
missing a doctype declaration which can trigger standards-mode inconsistencies;
add the HTML5 doctype declaration (<!DOCTYPE html>) as the very first line of
v2/book/examples/NLog.Extensions.ThisClass.html so it appears before the
existing <h1> element and any other content, ensuring the document renders in
standards mode.
| <body> | ||
| <h1> | ||
| This is the list of 260 RSCG with examples => | ||
| This is the list of 261 RSCG with examples => |
There was a problem hiding this comment.
Escape special character to satisfy HTML linting.
Line 20 uses a raw > in text content; this is currently flagged by HTMLHint (spec-char-escape).
🔧 Proposed fix
-This is the list of 261 RSCG with examples =>
+This is the list of 261 RSCG with examples =>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| This is the list of 261 RSCG with examples => | |
| This is the list of 261 RSCG with examples => |
🧰 Tools
🪛 HTMLHint (1.9.2)
[error] 20-20: Special characters must be escaped : [ > ].
(spec-char-escape)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/book/list.html` at line 20, The raw '>' character in the text "This is the
list of 261 RSCG with examples =>" is triggering HTML linting
(spec-char-escape); update the text in v2/book/list.html (the string containing
"This is the list of 261 RSCG with examples =>") to escape the greater-than sign
(e.g., replace '>' with '>') so the content is valid HTML and passes
HTMLHint.
| 26 [SyncMethodGenerator](/docs/SyncMethodGenerator) [](https://www.nuget.org/packages/Zomp.SyncMethodGenerator/)  2023-08-14 | ||
|
|
||
| 27 [System.Text.RegularExpressions](/docs/System.Text.RegularExpressions) [](https://www.nuget.org/packages/System.Text.RegularExpressions/)  2023-04-16 | ||
| 27 [System.Runtime.InteropServices](/docs/System.Runtime.InteropServices) [](https://www.nuget.org/packages/System.Runtime.InteropServices/)  2023-04-16 |
There was a problem hiding this comment.
Line 57 has a malformed badge URL.
https://img.shields.io/www.nuget.org/stars/packages/System.Runtime.InteropServices?style=social is not a valid Shields endpoint format and is likely rendering a broken badge.
🛠️ Suggested fix
- 27 [System.Runtime.InteropServices](/docs/System.Runtime.InteropServices) [](https://www.nuget.org/packages/System.Runtime.InteropServices/)  2023-04-16
+ 27 [System.Runtime.InteropServices](/docs/System.Runtime.InteropServices) [](https://www.nuget.org/packages/System.Runtime.InteropServices/)  2023-04-16📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 27 [System.Runtime.InteropServices](/docs/System.Runtime.InteropServices) [](https://www.nuget.org/packages/System.Runtime.InteropServices/)  2023-04-16 | |
| 27 [System.Runtime.InteropServices](/docs/System.Runtime.InteropServices) [](https://www.nuget.org/packages/System.Runtime.InteropServices/)  2023-04-16 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples_site/docs/Categories/EnhancementClass.md` at line 57, The
badge URL string
"https://img.shields.io/www.nuget.org/stars/packages/System.Runtime.InteropServices?style=social"
in EnhancementClass.md is malformed; replace or remove that badge. Locate the
badge next to the existing NuGet download badge (the string containing
System.Runtime.InteropServices) and either remove the invalid
"www.nuget.org/stars" badge or swap it for a valid Shields endpoint such as a
NuGet version/download badge (for example use
"https://img.shields.io/nuget/v/System.Runtime.InteropServices?label=nuget" or
"https://img.shields.io/nuget/dt/System.Runtime.InteropServices?label=System.Runtime.InteropServices")
or, if you intended to show repo stars, replace with a GitHub stars badge using
the correct repo owner/name via
"https://img.shields.io/github/stars/{owner}/{repo}?style=social".
| {"typeStep":"waitseconds","arg":"30"}, | ||
| {"typeStep":"text","arg": "Remember, you can download the code from here"}, | ||
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/NLog.Extensions.ThisClass#download-example-net--c-", | ||
| SpeakTest=" "}, |
There was a problem hiding this comment.
Fix critical JSON syntax errors.
Line 36 contains multiple syntax errors that will prevent JSON parsing:
- Property key
SpeakTestis not quoted - Uses
=instead of: - The property is incorrectly placed inside the previous object instead of as a separate array element
Additionally, line 38 has a trailing comma after the last array element, which is invalid in strict JSON.
🐛 Proposed fix
If SpeakTest should be a property on the previous step object:
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/NLog.Extensions.ThisClass#download-example-net--c-",
-SpeakTest=" "},
+"SpeakTest":" "},
-{"typeStep":"waitseconds","arg":"30"},
+{"typeStep":"waitseconds","arg":"30"}
]
}If SpeakTest should be a separate step (more likely):
-{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/NLog.Extensions.ThisClass#download-example-net--c-",
-SpeakTest=" "},
+{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/NLog.Extensions.ThisClass#download-example-net--c-"},
+{"typeStep":"text","arg":" "},
-{"typeStep":"waitseconds","arg":"30"},
+{"typeStep":"waitseconds","arg":"30"}
]
}🧰 Tools
🪛 Biome (2.4.9)
[error] 36-36: Property key must be double quoted
(parse)
[error] 36-36: unexpected character =
(parse)
[error] 36-36: expected , but instead found " "
(parse)
[error] 36-36: expected : but instead found }
(parse)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples/NLog.Extensions.ThisClass/video.json` at line 36, Fix the
malformed JSON around the SpeakTest token: either add SpeakTest as a quoted
property on the preceding step object (e.g., add "SpeakTest": "..." inside that
object) or, more likely, make SpeakTest a separate array element by replacing
the invalid unquoted `SpeakTest=" "` with a proper JSON object like
{"SpeakTest": " "} as its own array entry; also remove the trailing comma after
the final array element on line 38 so the array ends with a valid element
instead of a dangling comma.
There was a problem hiding this comment.
Pull request overview
Adds a new Roslyn Source Generator example for NLog.Extensions.ThisClass and updates the repo’s generated indices/exports (site + book) to include it as example #261.
Changes:
- Introduces a new
NLog.Extensions.ThisClasssample project (csproj + minimal demo code + NLog config) and its accompanying metadata (description/readme/nuget/video/tour). - Updates aggregated datasets and lists (CSV/JSON exports, docs indexes, category/author pages, homepage counts, book inputs).
- Adds generated downloadable artifacts for the site (zip source bundle; updated JSON/XLSX exports).
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| v2/RSCGExamplesData/GeneratorDataRec.json | Registers the new generator entry for processing/display. |
| v2/rscg_examples/NLog.Extensions.ThisClass/video.json | Adds the scripted video steps for the new example. |
| v2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/Program.cs | Demo app entry point showcasing usage. |
| v2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/Person.cs | Demo class annotated for logger generation and using generated logger. |
| v2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/NLog.config | Provides NLog configuration used by the demo. |
| v2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo/LogDemo.csproj | New example project file referencing NLog + generator package. |
| v2/rscg_examples/NLog.Extensions.ThisClass/src/LogDemo.slnx | Minimal solution container for the example project. |
| v2/rscg_examples/NLog.Extensions.ThisClass/readme.txt | Captures upstream README content used for docs. |
| v2/rscg_examples/NLog.Extensions.ThisClass/nuget.txt | Short NuGet summary used in generated docs. |
| v2/rscg_examples/NLog.Extensions.ThisClass/description.json | Metadata driving doc generation (author/links/“goodFor”/file list). |
| v2/rscg_examples_site/static/sources/NLog.Extensions.ThisClass.zip | Downloadable source bundle for the example. |
| v2/rscg_examples_site/static/exports/RSCG.xlsx | Updated spreadsheet export including the new example. |
| v2/rscg_examples_site/static/exports/RSCG.json | Updated JSON export including the new example. |
| v2/rscg_examples_site/src/components/HomepageFeatures/index.js | Updates homepage example count to 261. |
| v2/rscg_examples_site/docs/RSCG-Examples/NLog.Extensions.ThisClass.md | Adds the generated documentation page for the new example. |
| v2/rscg_examples_site/docs/RSCG-Examples/index.md | Updates category list/counts and adds the new entry. |
| v2/rscg_examples_site/docs/indexRSCG.md | Updates chronological list/counts and adds #261 entry. |
| v2/rscg_examples_site/docs/Categories/EnhancementClass.md | Updates category count and inserts the new entry. |
| v2/rscg_examples_site/docs/Categories/_PrimitiveEnhancementClass.mdx | Updates category primitive list to include the new entry. |
| v2/rscg_examples_site/docs/Authors/Trym_Pet.md | Adds author page for the generator author. |
| v2/rscg_examples_site/docs/about.md | Updates overall example count to 261. |
| v2/Generator/all.csv | Adds the generator to the master generator list. |
| v2/book/pandocHTML.yaml | Includes the new example HTML in book generation inputs. |
| v2/book/list.html | Updates book list count and adds link for #261. |
| v2/book/examples/NLog.Extensions.ThisClass.html | Adds the book HTML page for the new example. |
| v2/.tours/NLog.Extensions.ThisClass.tour | Adds VS Code CodeTour steps for the example. |
| README.md | Updates repo-wide counts and latest update section for #261. |
| later.md | Updates latest update date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "source":"https://github.com/trympet/ThisClass" | ||
| }, | ||
| "data":{ | ||
| "goodFor":["Generate the NLog register for a class."], |
There was a problem hiding this comment.
The "goodFor" description says "Generate the NLog register for a class", but the package/docs describe creating class loggers. Consider changing this to "Generate an NLog logger for a class" (or similar) for clarity/consistency across generated docs.
| "goodFor":["Generate the NLog register for a class."], | |
| "goodFor":["Generate an NLog logger for a class."], |
| Console.WriteLine("Hello, World!"); | ||
| var person = new Person() \{ FirstName = "Andrei", LastName = "Ignat" }; | ||
| Console.WriteLine(person.Name()); |
There was a problem hiding this comment.
The C# snippet escapes { as \\{ (e.g., new Person() \\{ ... }), which makes the rendered/copyable code invalid. Please remove the unnecessary escaping so the snippet matches Program.cs.
| { | ||
| public string FirstName \{ get; set; }= string.Empty; | ||
| public string LastName \{ get; set; \} = string.Empty; |
There was a problem hiding this comment.
This snippet escapes property braces (e.g., FirstName \\{ get; set; } and LastName \\{ get; set; \\}), which renders as invalid C#. Please remove the backslashes so the documentation matches the actual Person.cs.
| --- | ||
| sidebar_position: 2610 | ||
| title: 261 - NLog.Extensions.ThisClass | ||
| description: Generate the NLog register for a class. |
There was a problem hiding this comment.
The front-matter description says "Generate the NLog register for a class", which reads like a terminology/typo mismatch (the library creates class loggers). Consider changing this to "Generate an NLog logger for a class" for clarity and consistency with the NuGet summary.
| description: Generate the NLog register for a class. | |
| description: Generate an NLog logger for a class. |
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, | ||
| {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, | ||
|
|
||
| {"typeStep":"text","arg": "Today I will present NLog.Extensions.ThisClass . Generate the NLog register for a class. ."}, |
There was a problem hiding this comment.
The narration text says "Generate the NLog register for a class", which looks like a terminology/typo mismatch (this generator creates class loggers). Consider adjusting the wording to "Generate an NLog logger for a class" for clarity/consistency with the NuGet description.
| {"typeStep":"text","arg": "Today I will present NLog.Extensions.ThisClass . Generate the NLog register for a class. ."}, | |
| {"typeStep":"text","arg": "Today I will present NLog.Extensions.ThisClass . Generate an NLog logger for a class. ."}, |
Summary by CodeRabbit